home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / plymouth < prev    next >
Encoding:
Text File  |  2013-01-10  |  1.3 KB  |  92 lines

  1. #!/bin/sh
  2.  
  3. ### BEGIN INIT INFO
  4. # Provides:        plymouth
  5. # Required-Start:    udev $remote_fs $all
  6. # Required-Stop:    $remote_fs
  7. # Should-Start:        gdm gdm3 kdm xdm slim nodm
  8. # Should-Stop:
  9. # Default-Start:    2 3 4 5
  10. # Default-Stop:
  11. # Short-Description:    Stop plymouth during boot and start it on shutdown
  12. ### END INIT INFO
  13.  
  14. PATH="/sbin:/bin:/usr/sbin:/usr/bin"
  15. NAME="plymouth"
  16. DESC="Boot splash manager"
  17. SPLASH="false"
  18.  
  19. test -x /sbin/plymouthd || exit 0
  20.  
  21. if [ -r "/etc/default/${NAME}" ]
  22. then
  23.     . "/etc/default/${NAME}"
  24. fi
  25.  
  26. set -e
  27.  
  28. Start_plymouthd ()
  29. {
  30.     if ! plymouth --ping
  31.     then
  32.         /sbin/plymouthd --mode=${1} --attach-to-session
  33.     fi
  34. }
  35.  
  36. for ARGUMENT in $(cat /proc/cmdline)
  37. do
  38.     case "${ARGUMENT}" in
  39.         splash*)
  40.             SPLASH="true"
  41.             ;;
  42.  
  43.         nosplash*)
  44.             SPLASH="false"
  45.             ;;
  46.     esac
  47. done
  48.  
  49. case "${1}" in
  50.     start)
  51.         if [ "${SPLASH}" = "true" ]
  52.         then
  53.             /bin/plymouth --quit
  54.         fi
  55.         ;;
  56.  
  57.     stop)
  58.         if [ "$SPLASH" = "true" ]
  59.         then
  60.             Start_plymouthd shutdown
  61.  
  62.             RUNLEVEL="$(/sbin/runlevel | cut -d " " -f 2)"
  63.  
  64.             case "${RUNLEVEL}" in
  65.                 0)
  66.                     TEXT="Shutting down system..."
  67.                     ;;
  68.  
  69.                 6)
  70.                     TEXT="Restarting system..."
  71.                     ;;
  72.             esac
  73.  
  74.             /bin/plymouth message --text="${TEXT}"
  75.  
  76.             /bin/plymouth --show-splash
  77.         fi
  78.         ;;
  79.  
  80.     restart|force-reload)
  81.  
  82.         ;;
  83.  
  84.     *)
  85.         N="/etc/init.d/${NAME}"
  86.         echo "Usage: ${N} {start|stop|restart|force-reload}" >&2
  87.         exit 1
  88.         ;;
  89. esac
  90.  
  91. exit 0
  92.